
<!--{template admin/header}-->
<style type="text/css">
    .upimg_img{
        width:15%;
        padding: 5px;
        display: inline-block;
        text-align: center;
    }
    .upimg_img img{
        width:100%;
        margin: 8px 0;
    }
    a.u-del {
        color: #fff;
    }
    .u-del {
        background: #ddd;
        width: 15px;
        height: 15px;
        color: #fff;
        text-align: center;
        line-height: 15px;
        display: inline-block;
    }
    .input-group-addon {
        padding: 6px 12px;
        font-size: 14px;
        font-weight: normal;
        line-height: 1;
        text-align: center;
        background-color: #eeeeee;
        border: 1px solid #cccccc;
        border-radius: 4px;
    }
</style>

<script type="text/javascript" src="static/js/imgupload.js"></script>
<script type="text/javascript">
    $(function(){
        $('#publisher_file').uploadify({
            'uploader':'{conf site_url}/images/uploadify/uploadify.swf?id=&random=' + Math.random(), 
            'script':'{echo urlencode({conf site_url}."/ajax.php?mod=uploadify&code=uploadimg")}', 
            'cancelImg':'{conf site_url}/images/uploadify/cancel.png', 
            'buttonImg':'{conf site_url}/images/uploadify/upload.gif', 
            'width':52, 
            'height':52, 
            'multi':true, 
            'auto':true, 
            'sizeLimit':'{conf image_size_limit}', 
            'fileExt':'*.jpg;*.png;*.gif;*.jpeg', 
            'fileDesc':'请选择图片文件(*.jpg;*.png;*.gif;*.jpeg)', 
            'queueID':'uploadifyQueueDiv', 
            'wmode':'transparent', 
            'fileDataName':'image', 
            'queueSizeLimit':'5', 
            'simUploadLimit':1, 
            'scriptData':{'cookie_auth':'{echo urlencode(jsg_getcookie("auth"))}'}, 
            'onSelect':function(event, ID, fileObj){}, 
            'onSelectOnce':function(event, data){ }, 
            'onProgress':function(event, ID, fileObj, data){return false; }, 
            'onComplete':function(event, ID, fileObj, response, data){
                eval('var r =' + response + ';'); 
                if (r.done){
                    var rv = r.retval; 
                    if (rv.id > 0 && rv.src.length > 0) {
                        var idval = ('undefined' == typeof (rv.id) ? 0 : rv.id);
                        var srcval = ('undefined' == typeof (rv.src) ? 0 : rv.src);
                        var imageIdsCount = 0;
                        $(".upimg_img").each(function() {
                            imageIdsCount += 1;
                        });
                        if (imageIdsCount >= 5) {
                            MessageBox('warning', '本次图片数量超过限制了');
                            return false;
                        }
                        $('#viewImgDiv').append("<div class='upimg_img' id='upimg_" + idval + "'><input type='hidden' name='topic[]' value='" + idval + "' /><input type='hidden' name='files[]' value='" + srcval + "' /><img src='" + srcval + "'/><a href='javascript:void(0);' onclick='imageUploadifyDelete(" + idval + "); return false;' title='删除图片' class='u-del'>X</a></div>");
                        //imageUploadifyComplete('{$h_key}', rv.id, rv.src, fileObj.name); 
                    }
                }
            }, 
            
        }); 
    });
</script>
<form method="post" action="admin.php?mod=mall&code=do_modify_slide_mall" enctype="multipart/form-data">
    <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
        <tr>
            <td class="altbg1" width="15%" bgcolor="#F8F8F8">商城弹出图片</td>
            <td class="altbg2" width="85%" align="right" bgcolor="#FFFFFF">
                <!--{if $slide_list['advert']}--><img src="{$slide_list['advert']}" width="300"><br><!--{/if}-->
                <input type="file" name="image" >（<span class="img_size">大小：640*968</span>）
            </td>
        </tr>
        <tr>
            <td class="altbg1" width="15%" bgcolor="#F8F8F8">商城轮播图片</td>
            <td class="altbg2" width="85%" align="right" bgcolor="#FFFFFF">
                <input type="file" name="images" id="publisher_file" >（<span class="img_size">大小：750*1061</span>，最多只能添加5张）
                <div id="viewImgDiv">
                    <!--{loop $slide_list['images'] $k $v}-->
                    <div class="upimg_img" id="upimg_{$v['tid']}">
                        <input type="hidden" name="topic[]" value="{$v['tid']}" />
                        <input type="hidden" name="files[]" value="{$v['img']}" />
                        <img src="{$v['img']}" />
                        <a href="javascript:void(0);" onclick="imageUploadifyDelete({$v['tid']}); return false;" title="删除图片" class="u-del">X</a></div>
                    <!--{/loop}-->
                </div>
            </td>
        </tr>
    </table>
    <center><input type="submit" class="button" id="submit" name="addsubmit" value="保 存"><a href="javascript:history.go(-1)" class="button" id="submit" name="addsubmit">返回</a></center>
</form>